package com.yangchao.quarkus.resource;

import com.yangchao.quarkus.config.StudentConfiguration;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

import java.util.Map;

@Path("/student")
public class StudentResource {


    @Inject
    StudentConfiguration studentConfiguration;

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Map name() {

        return Map.of(
                "name", studentConfiguration.name(),
                "age", studentConfiguration.age(),
                "desc", studentConfiguration.desc(),
                "favorite", studentConfiguration.favorite());
    }

}
